#
# @lc app=leetcode.cn id=1331 lang=python
#
# [1331] 数组序号转换
#

# @lc code=start
class Solution(object):
    def arrayRankTransform(self, arr):
        """
        :type arr: List[int]
        :rtype: List[int]
        """
        arr2=sorted(set(arr))
        index_map={value:index+1 for index,value in enumerate(arr2)}
        result=[index_map[a] for a in arr]
        return result
# @lc code=end

